﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="AddQuiz.aspx.vb" Inherits="Assignment4.AddQuiz" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 155px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script src="../development-bundle/jquery-1.4.4.js" type="text/javascript"></script>
    <script src="../jQuery/jquery-ui-1.8.10.custom.min.js" type="text/javascript"></script>
    <script src="../tag-it-master/js/tag-it.js" type="text/javascript"></script>

    <link href="../development-bundle/themes/base/jquery.ui.all.css" rel="stylesheet"
        type="text/css" />

    <link href="../tag-it-master/css/jquery.tagit.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        $(function () {

            var availableTags = $("#<%= hdnDBTags.ClientID %>").val().split(',');

            $('#quiztags').tagit({ tagSource: availableTags, select: true });

            $("#<%= btnCreate.ClientID %>").click(function () {

                getTagsString($('#quiztags').tagit('assignedTags'))
            });

            function getTagsString(tags) {
                $("#<%= hdnSelectedTags.ClientID %>").val($('#quiztags').tagit('assignedTags'));
            }
        });
</script>

<asp:HiddenField ID="hdnDBTags" runat="server" />
<asp:HiddenField ID="hdnSelectedTags" runat="server" />



<h1>Add Quiz</h1>
    <table class="style1">
        <tr>
            <td class="style2">
                Name</td>
            <td>
                <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtName" CssClass="lblmessage" ErrorMessage="Enter Name" 
                    ValidationGroup="create">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Description</td>
            <td>
                <asp:TextBox ID="txtDescription" runat="server" Height="93px" 
                    TextMode="MultiLine" Width="669px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="txtDescription" CssClass="lblmessage" 
                    ErrorMessage="Enter Description" ValidationGroup="create">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Picture</td>
            <td>
                <asp:FileUpload ID="fileUploadPicture" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="style2">
                Tags</td>
            <td>
                 <ul id="quiztags" name="nameOfSelect">
    </ul></td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
                    CssClass="lblmessage" ValidationGroup="create" />
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
                
            <td style="margin-left: 120px">
                <asp:Button ID="btnCreate" runat="server" Text="Create" 
                    OnClick="btnCreate_Quiz" ValidationGroup="create" Height="26px"  />
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td style="margin-left: 120px">
                <asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
            </td>
        </tr>
    </table>


</asp:Content>
